﻿#pragma once
//双向链表结构体
typedef struct bucket {
    int size;
    int timestamp = 0;
    struct bucket* prev;
    struct bucket* next;
}*pbucket, bucket;

//合并函数，用于在相同size的bucket超过2时进行链表的合并
extern int merge(pbucket tail, int n);
extern void destroy(pbucket head);
extern void destroy(pbucket head, pbucket end);
//修剪(销毁)超出window的bucket
extern void clip(int begin_time, pbucket head);
extern void show_result(int time, pbucket* head);
extern int calculate_DGIM(pbucket* h);